
<template>
	<view class="cardstyle">
		<text class="titlebox">{{title}}</text>
		<view class="tipsbox">
			<text style="color: red;" v-if="isTop">置顶</text>
			<text class="author">{{author}}</text>
			<text class="comments">{{comments}}评</text>
			<text class="time">{{time}}</text>
		</view>
	</view>
</template>
<script>
	export default {
		name: "cardViewText",
		data() {
			return {

			}
		},
		props: {
			title: {
				type: String,
				default: "新闻标题",
				require: true
			},
			isTop: {
				type: Boolean,
				default: false,
				require: true
			},
			author: {
				type: String,
				default: "来源",
				require: true
			},
			comments: {
				type: Number,
				default: 0,
				require: true
			},
			time: {
				type: String,
				default: "2025.1.1"
			},
			methods: {

			}
		}
	}
</script>

<style>
.cardstyle {
  padding: 10rpx;
  background-color: #e6f7fa;
}
.titlebox {
  display: block; /* 让标题独占一行 */
  font-size: 32rpx;
  margin-bottom: 8rpx; /* 标题与下方信息栏的间距 */
}
.tipsbox {
  display: flex;
  align-items: center; 
  font-size: 28rpx;
  color: #666; 
}
.tipsbox text{
	margin-right: 10rpx;
}
.author {
  margin-right: 8rpx; 
}
.comments {
  margin-right: 8rpx; 
}
.time {
  flex: 1; 
  text-align: right;
}
</style>